//! @Author: DengLibin 榆霖
//! @Date:  2022-07-05 11:22:35
//! @Description: 



use async_dao::{pojo::{UserParam, DbParam, PageInfo}, entity::user::User};

/// @Author: DengLibin 榆霖
/// @Date:  2022-07-05 13:45:01
/// @Description: 分页查询
pub async fn get_page(param: &DbParam) ->  Result<PageInfo<User>, Box<dyn std::error::Error>> {

    async_dao::user_dao::get_page(param.page, param.size, &param.pool).await
}

/// @Author: DengLibin 榆霖
/// @Date:  2022-07-11 12:21:58
/// @Description: 异步添加
pub async fn insert(param: &UserParam) ->  Result<(), Box<dyn std::error::Error>> {

    async_dao::user_dao::insert(&param.user, &param.pool).await
}
